package models

//type Param struct {
//	// 产品功能的参数的编码
//	Code string
//	// 产品功能的参数的名称
//	Name string
//	// 产品功能的参数的数据类型
//	Type string
//}
type ProductResourceOperation struct {
	ProductResource   string            `json:"productResource,omitempty" yaml:"productResourceId" validate:"required"` // The replacement of Object field
	ProductResourceId string            `json:"productResourceId" yaml:"productResourceId" validate:"required"`         // The replacement of Object field
	DefaultValue      string            `json:"defaultValue" yaml:"defaultValue"`
	Mappings          map[string]string `json:"mappings" yaml:"mappings"`
	Code              string            `json:"code" yaml:"code"`
	ValueType         string            `json:"valueType" yaml:"valueType"`
}

type ProductCommand struct {
	Description        string                     `json:"description"`
	Name               string                     `json:"name" yaml:"name" validate:"required,edgex-dto-none-empty-string,edgex-dto-rfc3986-unreserved-chars"`
	Code               string                     `json:"code,omitempty"` // 产品功能code
	IsHidden           bool                       `json:"isHidden" yaml:"isHidden"`
	ReadWrite          string                     `json:"readWrite" yaml:"readWrite" validate:"required,oneof='R' 'W' 'RW' 'WR'"`
	ResourceOperations []ProductResourceOperation `json:"resourceOperations" yaml:"resourceOperations" validate:"gt=0,dive"`
}

type ProductFunction struct {
	Id        string         `json:"id"`             // 产品功能id
	ProductId string         `json:"productId"`      // 产品id
	Command   ProductCommand `json:"productCommand"` // 产品功能command
}
